home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / SharedMemory-umax.cc,v < prev    next >
Text File  |  1989-05-09  |  2KB  |  122 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @@;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.37.22;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.49.14;  author grunwald;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     88.10.30.13.04.37;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     88.09.28.22.13.35;  author grunwald;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @@
  32.  
  33.  
  34. 3.2
  35. log
  36. @Start using Gnu library heaps for schedulers
  37. @
  38. text
  39. @// This may look like C code, but it is really -*- C++ -*-
  40. // 
  41. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  42. //
  43. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  44. //
  45. #include "SharedMemory.h"
  46. #include "assert.h"
  47. #include "Pragma.h"
  48.  
  49. PRAGMA_LINKAGE_C
  50. extern char *sbrk(unsigned);
  51. extern void perror(char *);
  52. extern void exit(int x = 0);
  53. extern char * share( unsigned, unsigned );
  54. PRAGMA_LINKAGE
  55.  
  56. //
  57. //    Not really a part of CpuMultiplexor, but used by it & hidden here.
  58. //
  59. void
  60. SharedMemoryInit( unsigned extra )
  61. {
  62.     //
  63.     // Bump the break if necessary.
  64.     // 
  65.     assert(extra >= 0);
  66.     char * newBreak = sbrk( extra );
  67.     if ( newBreak == (char *) -1 ) {
  68.     perror( "Share: sbrk" );
  69.     exit( 1 );
  70.     }
  71.     newBreak = sbrk( 0 );
  72.     
  73.     //
  74.     // Share .data, .bss, and the extra.
  75.     // 
  76.     extern int environ;
  77.     unsigned shareStart = (unsigned) &environ;
  78.     unsigned shareSize = (unsigned) newBreak - shareStart;
  79.     char * sharePointer = share( shareStart, shareSize );
  80.     if ( sharePointer == 0 ) {
  81.     perror( "Share: share" );
  82.     exit( 1 );
  83.     }
  84.  
  85.     extern void disableFurtherBreaks();
  86.     disableFurtherBreaks();
  87. }
  88. @
  89.  
  90.  
  91. 3.1
  92. log
  93. @Steay version
  94. @
  95. text
  96. @@
  97.  
  98.  
  99. 1.2
  100. log
  101. @*** empty log message ***
  102. @
  103. text
  104. @d9 1
  105. d11 1
  106. d15 2
  107. a38 1
  108.     extern char * share( unsigned, unsigned );
  109. @
  110.  
  111.  
  112. 1.1
  113. log
  114. @Initial revision
  115. @
  116. text
  117. @d1 6
  118. d15 1
  119. a15 1
  120. //    Not really a part of HardwareCpu, but used by it & hidden here.
  121. @
  122.